package com.test.contract;

import android.content.Intent;
import android.os.Bundle;
import android.widget.EditText;
import android.widget.TextView;

import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

/**
 * Anchor : Create by CimZzz
 * Time : 2020/06/07 15:11:25
 * Project : contract
 * Since Version : Alpha
 */
public class DetailActivity extends AppCompatActivity {
    TextView nameTxt;
    TextView workTxt;
    TextView phoneTxt;
    TextView qqTxt;
    TextView addressTxt;

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_detail);
        Intent intent = getIntent();
        if(intent == null) {
            finish();
            return;
        }
        User user = (User) intent.getSerializableExtra("User");
        if(user == null) {
            finish();
            return;
        }
        nameTxt = findViewById(R.id.nameTxt);
        workTxt = findViewById(R.id.workTxt);
        phoneTxt = findViewById(R.id.phoneTxt);
        qqTxt = findViewById(R.id.qqTxt);
        addressTxt = findViewById(R.id.addressTxt);
        nameTxt.setText(user.getName());
        workTxt.setText(user.getWork());
        phoneTxt.setText(user.getPhone());
        qqTxt.setText(user.getQq());
        addressTxt.setText(user.getAddress());
    }
}
